package com.cloud.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.stereotype.Service;

import com.cloud.entity.SysUser;
import com.cloud.mapper.SysUserMapper;
import com.cloud.service.SysUserService;

@Service
public class SysUserServiceImpl implements SysUserService{
	@Autowired
	SysUserMapper sysUserMapper;

	@Override
	public int save(SysUser user) {
		BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
        System.out.println(passwordEncoder.encode(user.getPassword()));//这个是加密的，这里没有特殊意义，在添加用户或者注册的时候调用这个方法加密密码
		return sysUserMapper.insert(user);
	}
	
	
}
